#ifndef INC_UTEGNUDB
#define INC_UTEGNUDB

#include <sqlite3.h>
#include <string>
#include <iostream>

#include "Patient.h"
#include "Evaluation.h"
#include "Symptoms.h"

#define UTEGNU_PRINTPATIENTLIST_OK 0
#define UTEGNU_PRINTPATIENTLIST_NOPATIENTS 1
#define UTEGNU_PRINTPATIENTLIST_SQLERROR 3

using namespace std;
//class Patient;

class UteGnuDb {
	private:
		sqlite3 *db;

	public:
        UteGnuDb() {}
		UteGnuDb(char *db_path);
		~UteGnuDb();

        int printPatientList();
		bool openDatabase(char *db_path);
		void insertPatient(Patient *p);
		int removePatient(Patient *p);
		void selectPatient(int id);
		void insertEvaluation(Evaluation*app);
		const char *errormsg();
		int getPatientArr(Patient **ps);
		int getEvaluationsArrByPatientId(Evaluation **evals, int id);

};

static int printPatientListCallback(void *NotUsed, int argc, char **argv, char **azColName);
static int selectPatientCallback(void *NotUsed, int argc, char **argv, char **azColName);
static int getPatientArrCallback(void *ps, int argc, char **argv, char **azColName);

#endif
